<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="iso-8859-1">
<title>TimeStamp (Commons Net 3.3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="TimeStamp (Commons Net 3.3 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/TimeStamp.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/net/ntp/TimeInfo.html" title="class in org.apache.commons.net.ntp"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/net/ntp/TimeStamp.html" target="_top">Frames</a></li>
<li><a href="TimeStamp.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.net.ntp</div>
<h2 title="Class TimeStamp" class="title">Class TimeStamp</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.net.ntp.TimeStamp</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&gt;</dd>
</dl>
<hr>
<br>
<pre>public class <a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.45">TimeStamp</a>
extends <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&gt;</pre>
<div class="block">TimeStamp class represents the Network Time Protocol (NTP) timestamp
 as defined in RFC-1305 and SNTP (RFC-2030). It is represented as a
 64-bit unsigned fixed-point number in seconds relative to 0-hour on 1-January-1900.
 The 32-bit low-order bits are the fractional seconds whose precision is
 about 200 picoseconds. Assumes overflow date when date passes MAX_LONG
 and reverts back to 0 is 2036 and not 1900. Test for most significant
 bit: if MSB=0 then 2036 basis is used otherwise 1900 if MSB=1.
 <p>
 Methods exist to convert NTP timestamps to and from the equivalent Java date
 representation, which is the number of milliseconds since the standard base
 time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
 </p></div>
<dl><dt><span class="strong">Version:</span></dt>
  <dd>$Revision: 1489361 $</dd>
<dt><span class="strong">Author:</span></dt>
  <dd>Jason Mathews, MITRE Corp</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a>, 
<a href="../../../../../serialized-form.html#org.apache.commons.net.ntp.TimeStamp">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#msb0baseTime">msb0baseTime</a></strong></code>
<div class="block">baseline NTP time if bit-0=0 -> 7-Feb-2036 @ 06:28:16 UTC</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#msb1baseTime">msb1baseTime</a></strong></code>
<div class="block">baseline NTP time if bit-0=1 -> 1-Jan-1900 @ 01:00:00 UTC</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#NTP_DATE_FORMAT">NTP_DATE_FORMAT</a></strong></code>
<div class="block">Default NTP date string format.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#TimeStamp(java.util.Date)">TimeStamp</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;d)</code>
<div class="block">Constructs a newly allocated NTP timestamp object
 that represents the Java Date argument.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#TimeStamp(long)">TimeStamp</a></strong>(long&nbsp;ntpTime)</code>
<div class="block">Constructs a newly allocated NTP timestamp object
 that represents the native 64-bit long argument.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#TimeStamp(java.lang.String)">TimeStamp</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)</code>
<div class="block">Constructs a newly allocated NTP timestamp object
 that represents the value represented by the string
 in hexdecimal form (e.g.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#compareTo(org.apache.commons.net.ntp.TimeStamp)">compareTo</a></strong>(<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&nbsp;anotherTimeStamp)</code>
<div class="block">Compares two Timestamps numerically.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#decodeNtpHexString(java.lang.String)">decodeNtpHexString</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)</code>
<div class="block">Convert NTP timestamp hexstring (e.g.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#equals(java.lang.Object)">equals</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Compares this object against the specified object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getCurrentTime()">getCurrentTime</a></strong>()</code>
<div class="block">Constructs a NTP timestamp object and initializes it so that
 it represents the time at which it was allocated, measured to the
 nearest millisecond.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getDate()">getDate</a></strong>()</code>
<div class="block">Convert NTP timestamp to Java Date object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getFraction()">getFraction</a></strong>()</code>
<div class="block">Returns low-order 32-bits representing the fractional seconds.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getNtpTime(long)">getNtpTime</a></strong>(long&nbsp;date)</code>
<div class="block">Helper method to convert Java time to NTP timestamp object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getSeconds()">getSeconds</a></strong>()</code>
<div class="block">Returns high-order 32-bits representing the seconds of this NTP timestamp.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getTime()">getTime</a></strong>()</code>
<div class="block">Convert NTP timestamp to Java standard time.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#getTime(long)">getTime</a></strong>(long&nbsp;ntpTimeValue)</code>
<div class="block">Convert 64-bit NTP timestamp to Java standard time.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#hashCode()">hashCode</a></strong>()</code>
<div class="block">Computes a hashcode for this Timestamp.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#ntpValue()">ntpValue</a></strong>()</code>
<div class="block">Returns the value of this Timestamp as a long value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#parseNtpString(java.lang.String)">parseNtpString</a></strong>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)</code>
<div class="block">Parses the string argument as a NTP hexidecimal timestamp representation string
 (e.g.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#toDateString()">toDateString</a></strong>()</code>
<div class="block">Converts this <code>TimeStamp</code> object to a <code>String</code>
 of the form:
 </div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#toNtpTime(long)">toNtpTime</a></strong>(long&nbsp;t)</code>
<div class="block">Converts Java time to 64-bit NTP time representation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#toString()">toString</a></strong>()</code>
<div class="block">Converts this <code>TimeStamp</code> object to a <code>String</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#toString(long)">toString</a></strong>(long&nbsp;ntpTime)</code>
<div class="block">Converts 64-bit NTP timestamp value to a <code>String</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html#toUTCString()">toUTCString</a></strong>()</code>
<div class="block">Converts this <code>TimeStamp</code> object to a <code>String</code>
 of the form:
 </div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="msb0baseTime">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>msb0baseTime</h4>
<pre>protected static final&nbsp;long <a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.52">msb0baseTime</a></pre>
<div class="block">baseline NTP time if bit-0=0 -> 7-Feb-2036 @ 06:28:16 UTC</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.net.ntp.TimeStamp.msb0baseTime">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="msb1baseTime">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>msb1baseTime</h4>
<pre>protected static final&nbsp;long <a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.57">msb1baseTime</a></pre>
<div class="block">baseline NTP time if bit-0=1 -> 1-Jan-1900 @ 01:00:00 UTC</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.net.ntp.TimeStamp.msb1baseTime">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="NTP_DATE_FORMAT">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NTP_DATE_FORMAT</h4>
<pre>public static final&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.63">NTP_DATE_FORMAT</a></pre>
<div class="block">Default NTP date string format. E.g. Fri, Sep 12 2003 21:06:23.860.
 See <code>java.text.SimpleDateFormat</code> for code descriptions.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.net.ntp.TimeStamp.NTP_DATE_FORMAT">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="TimeStamp(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TimeStamp</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.93">TimeStamp</a>(long&nbsp;ntpTime)</pre>
<div class="block">Constructs a newly allocated NTP timestamp object
 that represents the native 64-bit long argument.</div>
</li>
</ul>
<a name="TimeStamp(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TimeStamp</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.105">TimeStamp</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)
          throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></pre>
<div class="block">Constructs a newly allocated NTP timestamp object
 that represents the value represented by the string
 in hexdecimal form (e.g. "c1a089bd.fc904f6d").</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></code> - - if the string does not contain a parsable timestamp.</dd></dl>
</li>
</ul>
<a name="TimeStamp(java.util.Date)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TimeStamp</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.116">TimeStamp</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;d)</pre>
<div class="block">Constructs a newly allocated NTP timestamp object
 that represents the Java Date argument.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>d</code> - - the Date to be represented by the Timestamp object.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="ntpValue()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ntpValue</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.126">ntpValue</a>()</pre>
<div class="block">Returns the value of this Timestamp as a long value.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the 64-bit long value represented by this object.</dd></dl>
</li>
</ul>
<a name="getSeconds()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSeconds</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.136">getSeconds</a>()</pre>
<div class="block">Returns high-order 32-bits representing the seconds of this NTP timestamp.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>seconds represented by this NTP timestamp.</dd></dl>
</li>
</ul>
<a name="getFraction()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFraction</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.146">getFraction</a>()</pre>
<div class="block">Returns low-order 32-bits representing the fractional seconds.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>fractional seconds represented by this NTP timestamp.</dd></dl>
</li>
</ul>
<a name="getTime()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTime</h4>
<pre>public&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.156">getTime</a>()</pre>
<div class="block">Convert NTP timestamp to Java standard time.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>NTP Timestamp in Java time</dd></dl>
</li>
</ul>
<a name="getDate()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDate</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.166">getDate</a>()</pre>
<div class="block">Convert NTP timestamp to Java Date object.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>NTP Timestamp in Java Date</dd></dl>
</li>
</ul>
<a name="getTime(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTime</h4>
<pre>public static&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.185">getTime</a>(long&nbsp;ntpTimeValue)</pre>
<div class="block">Convert 64-bit NTP timestamp to Java standard time.

 Note that java time (milliseconds) by definition has less precision
 then NTP time (picoseconds) so converting NTP timestamp to java time and back
 to NTP timestamp loses precision. For example, Tue, Dec 17 2002 09:07:24.810 EST
 is represented by a single Java-based time value of f22cd1fc8a, but its
 NTP equivalent are all values ranging from c1a9ae1c.cf5c28f5 to c1a9ae1c.cf9db22c.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>ntpTimeValue</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>the number of milliseconds since January 1, 1970, 00:00:00 GMT
 represented by this NTP timestamp value.</dd></dl>
</li>
</ul>
<a name="getNtpTime(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNtpTime</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.222">getNtpTime</a>(long&nbsp;date)</pre>
<div class="block">Helper method to convert Java time to NTP timestamp object.
 Note that Java time (milliseconds) by definition has less precision
 then NTP time (picoseconds) so converting Ntptime to Javatime and back
 to Ntptime loses precision. For example, Tue, Dec 17 2002 09:07:24.810
 is represented by a single Java-based time value of f22cd1fc8a, but its
 NTP equivalent are all values from c1a9ae1c.cf5c28f5 to c1a9ae1c.cf9db22c.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>date</code> - the milliseconds since January 1, 1970, 00:00:00 GMT.</dd>
<dt><span class="strong">Returns:</span></dt><dd>NTP timestamp object at the specified date.</dd></dl>
</li>
</ul>
<a name="getCurrentTime()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentTime</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.234">getCurrentTime</a>()</pre>
<div class="block">Constructs a NTP timestamp object and initializes it so that
 it represents the time at which it was allocated, measured to the
 nearest millisecond.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>NTP timestamp object set to the current time.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html?is-external=true#currentTimeMillis()" title="class or interface in java.lang"><code>System.currentTimeMillis()</code></a></dd></dl>
</li>
</ul>
<a name="decodeNtpHexString(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decodeNtpHexString</h4>
<pre>protected static&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.246">decodeNtpHexString</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)
                                  throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></pre>
<div class="block">Convert NTP timestamp hexstring (e.g. "c1a089bd.fc904f6d") to the NTP
 64-bit unsigned fixed-point number.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>NTP 64-bit timestamp value.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></code> - - if the string does not contain a parsable timestamp.</dd></dl>
</li>
</ul>
<a name="parseNtpString(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseNtpString</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.272">parseNtpString</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;s)
                                throws <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></pre>
<div class="block">Parses the string argument as a NTP hexidecimal timestamp representation string
 (e.g. "c1a089bd.fc904f6d").</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>s</code> - - hexstring.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the Timestamp represented by the argument in hexidecimal.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></code> - - if the string does not contain a parsable timestamp.</dd></dl>
</li>
</ul>
<a name="toNtpTime(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toNtpTime</h4>
<pre>protected static&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.284">toNtpTime</a>(long&nbsp;t)</pre>
<div class="block">Converts Java time to 64-bit NTP time representation.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>t</code> - Java time</dd>
<dt><span class="strong">Returns:</span></dt><dd>NTP timestamp representation of Java time value.</dd></dl>
</li>
</ul>
<a name="hashCode()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.318">hashCode</a>()</pre>
<div class="block">Computes a hashcode for this Timestamp. The result is the exclusive
 OR of the two halves of the primitive <code>long</code> value
 represented by this <code>TimeStamp</code> object. That is, the hashcode
 is the value of the expression:
 <blockquote><pre>
 (int)(this.ntpValue()^(this.ntpValue() >>> 32))
 </pre></blockquote></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>a hash code value for this object.</dd></dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.334">equals</a>(<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Compares this object against the specified object.
 The result is <code>true</code> if and only if the argument is
 not <code>null</code> and is a <code>Long</code> object that
 contains the same <code>long</code> value as this object.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a></code>&nbsp;in class&nbsp;<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - the object to compare with.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the objects are the same;
          <code>false</code> otherwise.</dd></dl>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.352">toString</a>()</pre>
<div class="block">Converts this <code>TimeStamp</code> object to a <code>String</code>.
 The NTP timestamp 64-bit long value is represented as hex string with
 seconds separated by fractional seconds by a decimal point;
 e.g. c1a089bd.fc904f6d <=> Tue, Dec 10 2002 10:41:49.986</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>NTP timestamp 64-bit long value as hex string with seconds
 separated by fractional seconds.</dd></dl>
</li>
</ul>
<a name="toString(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.381">toString</a>(long&nbsp;ntpTime)</pre>
<div class="block">Converts 64-bit NTP timestamp value to a <code>String</code>.
 The NTP timestamp value is represented as hex string with
 seconds separated by fractional seconds by a decimal point;
 e.g. c1a089bd.fc904f6d <=> Tue, Dec 10 2002 10:41:49.986</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>NTP timestamp 64-bit long value as hex string with seconds
 separated by fractional seconds.</dd></dl>
</li>
</ul>
<a name="toDateString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDateString</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.403">toDateString</a>()</pre>
<div class="block">Converts this <code>TimeStamp</code> object to a <code>String</code>
 of the form:
 <blockquote><pre>
 EEE, MMM dd yyyy HH:mm:ss.SSS</pre></blockquote>
 See java.text.SimpleDataFormat for code descriptions.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a string representation of this date.</dd></dl>
</li>
</ul>
<a name="toUTCString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toUTCString</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.422">toUTCString</a>()</pre>
<div class="block">Converts this <code>TimeStamp</code> object to a <code>String</code>
 of the form:
 <blockquote><pre>
 EEE, MMM dd yyyy HH:mm:ss.SSS UTC</pre></blockquote>
 See java.text.SimpleDataFormat for code descriptions.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a string representation of this date in UTC.</dd></dl>
</li>
</ul>
<a name="compareTo(org.apache.commons.net.ntp.TimeStamp)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>compareTo</h4>
<pre>public&nbsp;int&nbsp;<a href="../../../../../src-html/org/apache/commons/net/ntp/TimeStamp.html#line.445">compareTo</a>(<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&nbsp;anotherTimeStamp)</pre>
<div class="block">Compares two Timestamps numerically.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Comparable.html?is-external=true#compareTo(T)" title="class or interface in java.lang">compareTo</a></code>&nbsp;in interface&nbsp;<code><a href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../org/apache/commons/net/ntp/TimeStamp.html" title="class in org.apache.commons.net.ntp">TimeStamp</a>&gt;</code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>anotherTimeStamp</code> - - the <code>TimeStamp</code> to be compared.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value <code>0</code> if the argument TimeStamp is equal to
          this TimeStamp; a value less than <code>0</code> if this TimeStamp
          is numerically less than the TimeStamp argument; and a
          value greater than <code>0</code> if this TimeStamp is
          numerically greater than the TimeStamp argument
          (signed comparison).</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/TimeStamp.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/net/ntp/TimeInfo.html" title="class in org.apache.commons.net.ntp"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/net/ntp/TimeStamp.html" target="_top">Frames</a></li>
<li><a href="TimeStamp.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2001-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
